import { appConfig, setupGuard, setupLoginGuard } from '@idmy/core'
import { createRouter, createWebHashHistory, Router } from 'vue-router'
import { routes } from './routes'

export default function (): Router {
  const router = createRouter({
    history: createWebHashHistory(`/${appConfig.app.alias}/`),
    routes,
  })
  setupLoginGuard(router)
  setupGuard(router)
  return router
}
